#include "Udpserver.hpp"
#include <memory>
#include <string>

using namespace wxd;
int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        std::cerr<<"usage: "<<argv[0]<<" ip"<<std::endl;
        exit(1);
    }


    //std::string ip = argv[1];
    u_int16_t port = std::stoi(argv[1]);

    //用智能指针管理UdpServer
    std::unique_ptr<UdpServer> ptr_server = std::make_unique<UdpServer>(port);

    ptr_server->Init();
    ptr_server->Start();

    return 0;
}
